using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace TidhiGanitam.DataModel
{
    public class NakshatramuDetails
    {
        Enums.TidhiState m_NakshatramuState;
        double m_Nakshatramu;
        DateTime m_EndDate;
        Rasi m_EndTime;
        Rasi m_TotalSpan;

        public Enums.TidhiState NakshatramuState
        {
            get
            { return m_NakshatramuState; }
            set
            { m_NakshatramuState = value; }
        }
        public double NakshatramuIndex
        {
            get
            { return m_Nakshatramu; }
            set
            { m_Nakshatramu = value; }
        }
        public string Nakshatramu
        {
            get
            { return Constants.Nakshatramu[Convert.ToInt32(NakshatramuIndex)].ToString();}
        }
        public DateTime EndDate
        {
            get
            { return m_EndDate; }
            set
            {
                m_EndDate = value;
            }
        }
        public Rasi EndTime
        {
            get
            { return m_EndTime; }
            set
            { m_EndTime = value; }
        }
        public Rasi TotalSpan
        {
            get
            { return m_TotalSpan; }
            set
            { m_TotalSpan = value; }
        }
        public NakshatramuDetails(double NakshatramuIndex, Enums.TidhiState NakshatramuState, DateTime EndDate, Rasi EndTime, Rasi TotalSpan)
        {
            m_Nakshatramu = NakshatramuIndex;
            m_NakshatramuState = NakshatramuState;
            m_EndDate = EndDate;
            m_EndTime = EndTime;
            m_TotalSpan = TotalSpan;
        }
        public string GetNakshatramuDetailsString(Rasi Suryodayamu)
        {
            string NakshatramuString = Nakshatramu;
            if (NakshatramuState == Enums.TidhiState.Eshyam)
            {
                NakshatramuString = "Eshya(" + Nakshatramu + ")";
            }
            else if (NakshatramuState == Enums.TidhiState.Purti)
            {
                NakshatramuString = Nakshatramu + " Purti";
            }
            string retString = string.Format("{0} {1} ({2})", NakshatramuString, EndTime.DisplayFormat(Enums.DisplayFormat.LV),
                EndTime.GetTimeFormatString(new Rasi(Suryodayamu), true));
            return retString;
        }


    }
}
